package com.caiyi.financial.nirvana.sms.controller;


import com.caiyi.financial.nirvana.sms.service.SmsReceiveMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Api(description = "接收上行接口")
@RequestMapping("/sms/api/receive")
@RestController
public class SmsReceiveMsgController {

    @Autowired
    private SmsReceiveMsgService smsReceiveMsgService;

    @ApiOperation("接收上行短信")
    @ApiImplicitParam(name = "body", value = "上行短信参数", dataType = "String", paramType = "form")
    @RequestMapping(value = "/{gatewayId}", method = {RequestMethod.POST, RequestMethod.GET})
    public String status(@RequestParam Map<String, String> formData, @PathVariable("gatewayId") Integer gatewayId) {
        return smsReceiveMsgService.receiveMsg(formData, gatewayId);
    }
}
